# 条件循环  while
i = 1
while i <= 5:
    print('今天星期:', i)
    i = i + 1

# 计算
n = 1
s = 0
while n <= 100:
    s = s + n
    n = n + 1
    # print(sum)
print(sum)

# 遍历循环 for
for i in {1, 3, 5, 7}:
    print('所写的周期是', i)

# range 内置函数(1 2 3 4 5 6)
for i in range(10):
    print(i)
    print()

# 嵌套循环
# while嵌入while
i = 1
while i <= 5:
    print("上班星期为：, i")
    i = i + 1
    t = 9
    while t <= 17:
        print('时间段为:', t, end=" ")
        t = t + 1
    print()

# for嵌入for
for i in range(1, 6):
    print("上班时间为；", i)
    for t in range(9, 18):
        print("时间段", t, end=" ")
        print()

# 制作九九乘法表
# while制作
i = 1
while i <= 9:
    j = 1
    while j <= i:
        print('%d*%d=%d' % (j, i, j*i), end=" ")
        j = j + 1
    print()
    i = i + 1
# for制作
for i in range(1, 10):
    for j in range(1, i+1):
        print("%d*%d = %d" % (j, i, j*i), end=', ')
    print()


